package com.unjuanable.safetymonitor.adapter.driven.restful.controlmng;

import com.unjuanable.safetymonitor.application.controlmng.ControlDto;
import com.unjuanable.safetymonitor.application.controlmng.ControlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhengjiaxing
 * @description
 * @date 2023/1/11
 */
@RestController
public class ControlResource {

    private ControlService controlService;

    @Autowired
    public ControlResource(ControlService controlService) {
        this.controlService = controlService;
    }

    @PostMapping("api/controls")
    public ControlDto addControl(@RequestBody ControlDto request) {
        Long userId = null;
        return controlService.addControl(request, userId);
    }
}
